using System;
using System.Data;
using System.Data.SqlClient;

/// <summary>
/// Summary description for SqlServerDataProvider
/// </summary>
public partial class DataProvider 
{

    #region GetDataSet
    public DataSet GetDataSet( )
    {
        InitParameters();
        DataSet dataSet = new DataSet();
        
        SqlDataAdapter sqlDataAdapter = 
        new SqlDataAdapter(sqlCommand);
        
        sqlDataAdapter.Fill(dataSet);
        sqlCommand.Dispose();
        sqlDataAdapter.Dispose();
        return dataSet; 
    }     
    #endregion

    #region GetDataTable
    public DataTable GetDataTable()
    {
        InitParameters();
        DataTable dataTable = new DataTable();
         
        SqlDataAdapter sqlDataAdapter = 
        new SqlDataAdapter(sqlCommand);
        
        sqlDataAdapter.Fill(dataTable);
        sqlCommand.Dispose();
        sqlDataAdapter.Dispose();
        return dataTable;
    }
    public DataTable GetDataTable(int startRecord, int maxRecord)
    {
        InitParameters();
        DataTable dataTable = new DataTable();
         
        SqlDataAdapter sqlDataAdapter = 
        new SqlDataAdapter(sqlCommand);
        sqlDataAdapter.Fill(startRecord, maxRecord, dataTable);
        return dataTable;
    } 
    #endregion

    #region GetDataRow 
    public DataRow GetDataRow()
    {
        InitParameters();
        DataRow dataRow = null;
        DataTable dataTable = new DataTable();
         
        SqlDataAdapter sqlDataAdapter = 
        new SqlDataAdapter(sqlCommand);
        sqlDataAdapter.Fill(dataTable);
        if(dataTable.Rows.Count > 0 )
            dataRow = dataTable.Rows[0];
        sqlCommand.Dispose();
        sqlDataAdapter.Dispose();
        return dataRow;
    }    
    #endregion
    
}
